const express = require('express');
const router = express.Router();
const db = require('../../../../MySql');


// 获取所有分类
router.post('/sys/config/detail', async (req, res) => {
    try {
        const [results] = await db.query('SELECT id,site_name,back_logo,copy_right FROM sys_config WHERE id = 1;')
        return res.json({
            "msg": "操作成功！",
            "code": 0,
            "data": {
                "id": results[0].id,
                "siteName": results[0].site_name,
                "backLogo": results[0].back_logo,
                "copyRight": results[0].copy_right
            },
            "success": true
        })

    } catch (error) {
        return res.status(500).json({
            msg: "数据库查询失败",
            code: 500,
            success: false
        });
    }
})
module.exports = router;